﻿using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient.UI
{
    // Token: 0x02001903 RID: 6403
    internal class EquipTooltipDlg : TooltipDlg<EquipTooltipDlg, EquipTooltipDlgBehaviour>
    {
        // Token: 0x17003ABA RID: 15034
        // (get) Token: 0x06010B72 RID: 68466 RVA: 0x0042AFCC File Offset: 0x004291CC
        public override string fileName
        {
            get
            {
                return "GameSystem/EquipToolTipDlg";
            }
        }

        // Token: 0x17003ABB RID: 15035
        // (get) Token: 0x06010B73 RID: 68467 RVA: 0x0042AFE4 File Offset: 0x004291E4
        protected override int compareWindowDistance
        {
            get
            {
                return 20;
            }
        }

        // Token: 0x06010B74 RID: 68468 RVA: 0x0042AFF8 File Offset: 0x004291F8
        protected override void Init()
        {
            base.Init();
            this.m_OperateList[0, 0] = new TooltipButtonOperatePutOn();
            this.m_OperateList[0, 1] = new TooltipButtonOperateEnhanceTransform();
            this.m_OperateList[0, 2] = new TooltipButtonOperateEnchantTransform();
            this.m_OperateList[0, 3] = null; //zcg new TooltipButtonOperateRecycle(XSysDefine.XSys_Item_Equip);
            this.m_OperateList[0, 4] = null; //zcg new TooltipButtonOperateSmeltReturn();
            this.m_OperateList[1, 0] = new TooltipButtonOperateTakeOff();
            this.m_OperateList[1, 1] = null; //zcg new TooltipButtonOperateEnhance();
            this.m_OperateList[1, 2] = null; //zcg new TooltipButtonOperateSmelt();
            this.m_OperateList[1, 3] = null; //zcg new TooltipButtonOperateForge();
            this.m_OperateList[1, 4] = null; //zcg new TooltipButtonOperateEnchant();
            this.m_OperateList[1, 5] = null; //zcg new TooltipButtonOperateEquipFusion();
            this.m_OperateList[1, 6] = null; //zcg new TooltipButtonOperateEquipUpgrade();
        }

        // Token: 0x06010B75 RID: 68469 RVA: 0x0042B0E8 File Offset: 0x004292E8
        public override bool HideToolTip(bool forceHide = false)
        {
            bool result;
            if (base.HideToolTip(forceHide))
            {
                base.uiBehaviour.m_JadeItemPool.ReturnAll(false);
                result = true;
            }
            else
            {
                result = false;
            }
            return result;
        }

        // Token: 0x06010B76 RID: 68470 RVA: 0x0042B120 File Offset: 0x00429320
        public void ShowToolTip(ulong MainUID, ulong CompareUID, bool bShowButtons = true)
        {
            XItem itemByUID = XSingleton<XGame>.singleton.Doc.XBagDoc.GetItemByUID(MainUID);
            XItem xitem = XSingleton<XGame>.singleton.Doc.XBagDoc.GetItemByUID(CompareUID);
            if (xitem.uid == 0UL)
            {
                xitem = null;
            }
            this.ShowToolTip(itemByUID, xitem, bShowButtons, 0U);
        }

        // Token: 0x06010B77 RID: 68471 RVA: 0x0042B178 File Offset: 0x00429378
        private void _SetEnhanceAttrFrame(GameObject scrollPanel, XEquipItem equipItem, bool bMain)
        {
            GameObject gameObject = base.uiBehaviour.m_AttrFramePool.FetchGameObject(false);
            gameObject.transform.parent = scrollPanel.transform;
            string itemQualityColorStr = XSingleton<UiUtility>.singleton.GetItemQualityColorStr(1);
            AttrFrameParam attrFrameParam = new AttrFrameParam();
            attrFrameParam.Title = XStringDefineProxy.GetString("TOOLTIP_ENHANCE_ATTR");
            for (int i = 0; i < equipItem.enhanceInfo.EnhanceAttr.Count; i++)
            {
                AttrParam item = default(AttrParam);
                AttrParam.ResetSb();
                AttrParam.Append(equipItem.enhanceInfo.EnhanceAttr[i], itemQualityColorStr, itemQualityColorStr);
                item.SetTextFromSb();
                item.SetValueFromSb();
                attrFrameParam.AttrList.Add(item);
            }
            base.AppendFrame(gameObject, (float)this.SetupAttrFrame(gameObject, attrFrameParam, bMain), new Vector3?(base.uiBehaviour.m_AttrFramePool.TplPos));
            XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject);
        }

        // Token: 0x06010B78 RID: 68472 RVA: 0x0042B270 File Offset: 0x00429470
        private void _SetJadeAttrFrame(GameObject scrollPanel, XEquipItem equipItem, bool bMain)
        {
            if (equipItem != null)
            {
                uint level = 0U;
                if (XSingleton<XAttributeMgr>.singleton.XPlayerData != null)
                {
                    level = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
                }
                if (XSingleton<TooltipParam>.singleton.mainAttributes != null)
                {
                    level = XSingleton<TooltipParam>.singleton.mainAttributes.Level;
                }
                //zcg XJadeDocument specificDocument = XDocuments.GetSpecificDocument<XJadeDocument>(XJadeDocument.uuID);
                EquipList.RowData equipConf = XBagDocument.GetEquipConf(equipItem.itemID);
                if (equipConf != null)
                {
                    bool flag5 = false;//zcg specificDocument.JadeIsOpen(equipConf.EquipPos, level);
                    if (flag5)
                    {
                        GameObject gameObject = null;
                        AttrFrameParam attrFrameParam = null;
                        for (int i = 0; i < equipItem.jadeInfo.jades.Length; i++)
                        {
                            XJadeItem xjadeItem = equipItem.jadeInfo.jades[i];
                            if (xjadeItem != null)
                            {
                                ItemList.RowData itemConf = XBagDocument.GetItemConf(xjadeItem.itemID);
                                if (itemConf != null)
                                {
                                    if (gameObject == null)
                                    {
                                        gameObject = base.uiBehaviour.m_AttrFramePool.FetchGameObject(false);
                                        gameObject.transform.parent = scrollPanel.gameObject.transform;
                                        attrFrameParam = new AttrFrameParam();
                                        attrFrameParam.Title = XStringDefineProxy.GetString("TOOLTIP_JADE_ATTR");
                                    }
                                    foreach (XItemChangeAttr attr in xjadeItem.BasicAttr())
                                    {
                                        AttrParam item = default(AttrParam);
                                        AttrParam.ResetSb();
                                        AttrParam.TextSb.Append(XSingleton<UiUtility>.singleton.ChooseProfString(itemConf.ItemName, base.profession)).Append("  ");
                                        AttrParam.Append(attr, "", "");
                                        item.SetTextFromSb();
                                        item.SetValueFromSb();
                                        attrFrameParam.AttrList.Add(item);
                                    }
                                }
                            }
                        }
                        if (gameObject != null)
                        {
                            base.AppendFrame(gameObject, (float)this.SetupAttrFrame(gameObject, attrFrameParam, bMain), new Vector3?(base.uiBehaviour.m_AttrFramePool.TplPos));
                            XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject);
                        }
                    }
                }
            }
        }

        // Token: 0x06010B79 RID: 68473 RVA: 0x0042B4D8 File Offset: 0x004296D8
        protected override void SetAllAttrFrames(GameObject goToolTip, XAttrItem item, XAttrItem compareItem, bool bMain)
        {
            XEquipItem xequipItem = item as XEquipItem;
            if (xequipItem != null)
            {
                GameObject gameObject = goToolTip.transform.Find("ScrollPanel").gameObject;
                this.SetBasicAttrFrame(gameObject, item, compareItem, bMain);
                this._SetupRandAndForgeFrame(goToolTip, item, bMain);
                this._SetupEnchantFrame(goToolTip, item, compareItem, bMain);
                if (xequipItem.enhanceInfo.EnhanceLevel > 0U)
                {
                    this._SetEnhanceAttrFrame(gameObject, xequipItem, bMain);
                }
                uint level = 0U;
                if (XSingleton<XAttributeMgr>.singleton.XPlayerData != null)
                {
                    level = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
                }
                if (XSingleton<TooltipParam>.singleton.mainAttributes != null)
                {
                    level = XSingleton<TooltipParam>.singleton.mainAttributes.Level;
                }
                //zcg XJadeDocument specificDocument = XDocuments.GetSpecificDocument<XJadeDocument>(XJadeDocument.uuID);
                bool flag5 = false;
                EquipList.RowData equipConf = XBagDocument.GetEquipConf(xequipItem.itemID);
                if (equipConf != null)
                {
                    //zcg flag5 = specificDocument.JadeIsOpen(equipConf.EquipPos, level);
                }
                if (flag5)
                {
                    this._SetJadeAttrFrame(gameObject, xequipItem, bMain);
                }
            }
        }

        // Token: 0x06010B7A RID: 68474 RVA: 0x0042B5EC File Offset: 0x004297EC
        protected new void SetBasicAttrFrame(GameObject scrollPanel, XAttrItem item, XAttrItem compareItem, bool bMain)
        {
            GameObject gameObject = base.uiBehaviour.m_AttrFramePool.FetchGameObject(false);
            gameObject.transform.parent = scrollPanel.transform;
            uint profession = 0U;
            if (XSingleton<XEntityMgr>.singleton.Player != null)
            {
                profession = XSingleton<XEntityMgr>.singleton.Player.BasicTypeID;
            }
            if (XSingleton<TooltipParam>.singleton.mainAttributes != null)
            {
                profession = XSingleton<TooltipParam>.singleton.mainAttributes.BasicTypeID;
            }
            //zcg List<EquipFuseData> nowFuseData = EquipFusionDocument.Doc.GetNowFuseData(item, profession);
            AttrFrameParam attrFrameParam = new AttrFrameParam();
            attrFrameParam.Title = XStringDefineProxy.GetString("TOOLTIP_BASIC_ATTR");
            //zcg 
//             for (int i = 0; i < nowFuseData.Count; i++)
//             {
//                 AttrParam item2 = default(AttrParam);
//                 AttrParam.ResetSb();
//                 AttrParam.TextSb.Append(XAttributeCommon.GetAttrStr((int)nowFuseData[i].AttrId)).Append(" ").Append(nowFuseData[i].BeforeBaseAttrNum);
//                 if (nowFuseData[i].BeforeAddNum > 0U)
//                 {
//                     AttrParam.ValueSb.Append("+").Append(nowFuseData[i].BeforeAddNum);
//                 }
//                 item2.IsShowTipsIcon = nowFuseData[i].IsExtra;
//                 item2.IconName = "zb_rzsx";
//                 item2.SetTextFromSb();
//                 item2.SetValueFromSb();
//                 attrFrameParam.AttrList.Add(item2);
//             }
            base.AppendFrame(gameObject, (float)this.SetupAttrFrame(gameObject, attrFrameParam, bMain), new Vector3?(base.uiBehaviour.m_AttrFramePool.TplPos));
            this.SetAttrOther(scrollPanel.transform, attrFrameParam);
            Transform transform = gameObject.transform.Find("EquipRz");
            XEquipItem xequipItem = item as XEquipItem;
            if (transform != null)
            {
                if (xequipItem.fuseInfo.BreakNum == 0U)
                {
                    transform.gameObject.SetActive(false);
                }
                else
                {
                    //zcg 
//                     string fuseIconName = EquipFusionDocument.Doc.GetFuseIconName(xequipItem.fuseInfo.BreakNum);
//                     if (fuseIconName != null)
//                     {
//                         transform.gameObject.SetActive(true);
//                         IXUISprite ixuisprite = transform.GetComponent("XUISprite") as IXUISprite;
//                         ixuisprite.spriteName = fuseIconName;
//                     }
                }
            }
            transform = gameObject.transform.Find("RzLabel");
            if (transform != null)
            {
                EquipList.RowData equipConf = XBagDocument.GetEquipConf(xequipItem.itemID);
                if (equipConf != null)
                {
                    if (equipConf.FuseCanBreakNum > 0)
                    {
                        transform.gameObject.SetActive(true);
                        IXUILabel ixuilabel = transform.GetComponent("XUILabel") as IXUILabel;
                        ixuilabel.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("FuseBreakNum"), xequipItem.fuseInfo.BreakNum, equipConf.FuseCanBreakNum));
                    }
                    else
                    {
                        transform.gameObject.SetActive(false);
                    }
                }
                else
                {
                    transform.gameObject.SetActive(false);
                }
            }
            XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject);
        }

        // Token: 0x06010B7B RID: 68475 RVA: 0x0042B924 File Offset: 0x00429B24
        protected override void SetupTopFrame(GameObject goToolTip, ItemList.RowData data, bool bMain, XItem instanceData = null, XItem compareData = null)
        {
            base.SetupTopFrame(goToolTip, data, bMain, instanceData, compareData);
            Transform transform = goToolTip.transform;
            GameObject gameObject = transform.Find("TopFrame/State").gameObject;
            base._SetupLevel(goToolTip, data, 0);
            base._SetupProf(goToolTip, data, bMain, instanceData, 1);
            EquipList.RowData equipConf = XBagDocument.GetEquipConf(data.ItemID);
            base._SetTopFrameLabel(goToolTip, 2, XStringDefineProxy.GetString("ToolTipText_Part"), (equipConf != null) ? XSingleton<UiUtility>.singleton.GetEquipPartName((EquipPosition)equipConf.EquipPos, true) : string.Empty);
            gameObject.SetActive(!bMain || XSingleton<TooltipParam>.singleton.bEquiped);
        }

        // Token: 0x06010B7C RID: 68476 RVA: 0x0042B9C0 File Offset: 0x00429BC0
        protected override int _GetPPT(XItem item, bool bMain, ref string valueText)
        {
            XEquipItem xequipItem = item as XEquipItem;
            int result;
            if (xequipItem == null)
            {
                result = -1;
            }
            else
            {
                XAttributes attributes = bMain ? XSingleton<TooltipParam>.singleton.mainAttributes : XSingleton<TooltipParam>.singleton.compareAttributes;
                double num = xequipItem.GetPPT(attributes);
                if (xequipItem.randAttrInfo.bPreview)
                {
                    uint num2 = 0U;
                    uint num3 = 0U;
                    EquipSlotAttrDatas attrData = XCharacterEquipDocument.RandomAttrMgr.GetAttrData((uint)xequipItem.itemID);
                    if (attrData != null)
                    {
                        num2 = (uint)num + EquipSlotAttrDatas.GetMinPPT(attrData, attributes, false);
                        num3 = (uint)num + EquipSlotAttrDatas.GetMaxPPT(attrData, attributes);
                    }
                    //zcg 
                    //                     EquipSlotAttrDatas attrData2 = XForgeDocument.ForgeAttrMgr.GetAttrData((uint)xequipItem.itemID);
                    //                     if (attrData2 != null)
                    //                     {
                    //                         num2 += (uint)num + EquipSlotAttrDatas.GetMinPPT(attrData2, attributes, true);
                    //                         num3 += (uint)num + EquipSlotAttrDatas.GetMaxPPT(attrData2, attributes);
                    //                     }
                    valueText = string.Format("{0} - {1}", num2, num3);
                    result = -1;
                }
                else
                {
                    for (int i = 0; i < xequipItem.randAttrInfo.RandAttr.Count; i++)
                    {
                        num += XSingleton<XPowerPointCalculator>.singleton.GetPPT(xequipItem.randAttrInfo.RandAttr[i], attributes, -1);
                    }
                    for (int j = 0; j < xequipItem.forgeAttrInfo.ForgeAttr.Count; j++)
                    {
                        num += (uint)XSingleton<XPowerPointCalculator>.singleton.GetPPT(xequipItem.forgeAttrInfo.ForgeAttr[j], attributes, -1);
                    }
                    valueText = ((uint)num).ToString();
                    result = (int)num;
                }
            }
            return result;
        }

        // Token: 0x06010B7D RID: 68477 RVA: 0x0042BB69 File Offset: 0x00429D69
        protected override void SetupOtherFrame(GameObject goToolTip, XItem mainItem, XItem compareItem, bool bMain)
        {
            this._SetupSuitFrame(goToolTip, mainItem, compareItem, bMain);
            //zcg this._SetupJadeFrame(goToolTip, mainItem, compareItem, bMain);
            base.SetupOtherFrame(goToolTip, mainItem, compareItem, bMain);
        }

        // Token: 0x06010B7E RID: 68478 RVA: 0x0042BB90 File Offset: 0x00429D90
        private void _SetupJadeFrame(GameObject goToolTip, XItem mainItem, XItem compareItem, bool bMain)
        {
            XEquipItem xequipItem = mainItem as XEquipItem;
            if (xequipItem != null)
            {
                EquipList.RowData equipConf = XBagDocument.GetEquipConf(xequipItem.itemID);
                if (equipConf == null)
                {
                    XSingleton<XDebug>.singleton.AddErrorLog("equipListRowData == null while id = ", xequipItem.itemID.ToString(), null, null, null, null);
                }
                else
                {
                    uint num = 0U;
                    if (XSingleton<XAttributeMgr>.singleton.XPlayerData != null)
                    {
                        num = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
                    }
                    if (XSingleton<TooltipParam>.singleton.mainAttributes != null)
                    {
                        num = XSingleton<TooltipParam>.singleton.mainAttributes.Level;
                    }
                    //zcg 
//                     XJadeDocument specificDocument = XDocuments.GetSpecificDocument<XJadeDocument>(XJadeDocument.uuID);
//                     IXUISprite ixuisprite = goToolTip.transform.Find("JadeFrame").GetComponent("XUISprite") as IXUISprite;
//                     bool flag5 = specificDocument.JadeIsOpen(equipConf.EquipPos, num);
//                     if (!flag5)
//                     {
//                         ixuisprite.SetVisible(false);
//                     }
//                     else
//                     {
//                         SeqListRef<uint> slotInfoByPos = specificDocument.GetSlotInfoByPos(equipConf.EquipPos);
//                         int num2 = 4;
//                         int i;
//                         for (i = 0; i < (int)slotInfoByPos.count; i++)
//                         {
//                             if (i >= num2)
//                             {
//                                 break;
//                             }
//                             if (num >= slotInfoByPos[i, 1])
//                             {
//                                 GameObject gameObject = base.uiBehaviour.m_JadeItemPool.FetchGameObject(false);
//                                 gameObject.name = "jadeItem" + i;
//                                 Transform transform = goToolTip.transform.Find("JadeFrame/Jade" + i);
//                                 gameObject.transform.parent = ixuisprite.gameObject.transform;
//                                 gameObject.transform.localPosition = transform.localPosition;
//                                 gameObject.transform.localScale = Vector3.one;
//                                 XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject);
//                                 XJadeItem realItem = xequipItem.jadeInfo.jades[i];
//                                 XItemDrawerMgr.Param.Profession = base.profession;
//                                 XSingleton<XItemDrawerMgr>.singleton.jadeSlotDrawer.DrawItem(gameObject, slotInfoByPos[i, 0], false, realItem);
//                             }
//                         }
//                         if (i > 0)
//                         {
//                             this.bHadJade = true;
//                             ixuisprite.SetVisible(true);
//                             Vector3 localPosition = ixuisprite.gameObject.transform.localPosition;
//                             ixuisprite.gameObject.transform.localPosition = new Vector3(localPosition.x, -this.totalFrameHeight, localPosition.z);
//                             this.totalFrameHeight += (float)ixuisprite.spriteHeight;
//                         }
//                         else
//                         {
//                             ixuisprite.SetVisible(false);
//                         }
//                     }
                }
            }
        }

        // Token: 0x06010B7F RID: 68479 RVA: 0x0042BE48 File Offset: 0x0042A048
        private void _SetupRandAndForgeFrame(GameObject goToolTip, XItem mainItem, bool bMain)
        {
            XEquipItem xequipItem = mainItem as XEquipItem;
            //bool flag = !xequipItem.randAttrInfo.bPreview && xequipItem.randAttrInfo.RandAttr.Count == 0 && !xequipItem.forgeAttrInfo.bPreview && xequipItem.forgeAttrInfo.ForgeAttr.Count == 0;
            if (/*!flag*/xequipItem.randAttrInfo.bPreview || xequipItem.randAttrInfo.RandAttr.Count != 0 || xequipItem.forgeAttrInfo.bPreview || xequipItem.forgeAttrInfo.ForgeAttr.Count != 0)
            {
                EquipSlotAttrDatas attrData = XCharacterEquipDocument.RandomAttrMgr.GetAttrData((uint)xequipItem.itemID);
                EquipSlotAttrDatas attrData2 = null; //zcg  XForgeDocument.ForgeAttrMgr.GetAttrData((uint)xequipItem.itemID);
                //bool flag2 = attrData == null && attrData2 == null;
                if (/*!flag2*/attrData != null || attrData2 != null)
                {
                    GameObject gameObject = goToolTip.transform.Find("ScrollPanel").gameObject;
                    GameObject gameObject2 = base.uiBehaviour.m_AttrFramePool.FetchGameObject(false);
                    gameObject2.transform.parent = gameObject.transform;
                    string itemQualityColorStr = XSingleton<UiUtility>.singleton.GetItemQualityColorStr(2);
                    AttrFrameParam attrFrameParam = new AttrFrameParam();
                    attrFrameParam.Title = XStringDefineProxy.GetString("HIDDEN_ATTR");
                    if (xequipItem.randAttrInfo.bPreview)
                    {
                        AttrParam item = default(AttrParam);
                        AttrParam.ResetSb();
                        AttrParam.Append(AttrParam.TextSb, XStringDefineProxy.GetString("HIDDEN_ATTR"), itemQualityColorStr);
                        AttrParam.Append(AttrParam.ValueSb, "???", itemQualityColorStr);
                        item.SetTextFromSb();
                        item.SetValueFromSb();
                        attrFrameParam.AttrList.Add(item);
                    }
                    int count = xequipItem.randAttrInfo.RandAttr.Count;
                    List<XItemChangeAttr> list = new List<XItemChangeAttr>();
                    for (int i = 0; i < count; i++)
                    {
                        list.Add(xequipItem.randAttrInfo.RandAttr[i]);
                    }
                    for (int j = 0; j < xequipItem.forgeAttrInfo.ForgeAttr.Count; j++)
                    {
                        list.Add(xequipItem.forgeAttrInfo.ForgeAttr[j]);
                    }
                    for (int k = 0; k < list.Count; k++)
                    {
                        XItemChangeAttr xitemChangeAttr = list[k];
                        if (xitemChangeAttr.AttrID != 0U)
                        {
                            bool flag4 = k < count;
                            EquipSlotAttrDatas equipSlotAttrDatas;
                            int slot;
                            if (flag4)
                            {
                                equipSlotAttrDatas = attrData;
                                slot = k + 1;
                            }
                            else
                            {
                                equipSlotAttrDatas = attrData2;
                                slot = count - k + 1;
                            }
                            if (equipSlotAttrDatas != null)
                            {
                                AttrParam item2 = default(AttrParam);
                                AttrParam.ResetSb();
                                item2.IsShowTipsIcon = !flag4;
                                item2.IconName = "zb_dzsx";
                                EquipAttrData attrData3 = equipSlotAttrDatas.GetAttrData(slot, xitemChangeAttr);
                                if (attrData3 != null)
                                {
                                    string color = equipSlotAttrDatas.GetColor(slot, xitemChangeAttr);
                                    AttrParam.Append(xitemChangeAttr, color, color);
                                    AttrParam.ValueSb.Append(" [");
                                    AttrParam.ValueSb.Append(attrData3.RangValue.Min);
                                    AttrParam.ValueSb.Append(" - ");
                                    AttrParam.ValueSb.Append(attrData3.RangValue.Max);
                                    AttrParam.ValueSb.Append("] ");
                                }
                                else
                                {
                                    AttrParam.Append(xitemChangeAttr, itemQualityColorStr, itemQualityColorStr);
                                }
                                item2.SetTextFromSb();
                                item2.SetValueFromSb();
                                attrFrameParam.AttrList.Add(item2);
                            }
                        }
                    }
                    base.AppendFrame(gameObject2, (float)this.SetupAttrFrame(gameObject2, attrFrameParam, bMain), new Vector3?(base.uiBehaviour.m_AttrFramePool.TplPos));
                    XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject2);
                }
            }
        }

        // Token: 0x06010B80 RID: 68480 RVA: 0x0042C1E4 File Offset: 0x0042A3E4
        private void _SetupEnchantFrame(GameObject goToolTip, XItem mainItem, XItem compareItem, bool bMain)
        {
            XEquipItem xequipItem = mainItem as XEquipItem;
            if (xequipItem.enchantInfo.bHasEnchant)
            {
                GameObject gameObject = goToolTip.transform.Find("ScrollPanel").gameObject;
                GameObject gameObject2 = base.uiBehaviour.m_AttrFramePool.FetchGameObject(false);
                gameObject2.transform.parent = gameObject.transform;
                string itemQualityColorStr = XSingleton<UiUtility>.singleton.GetItemQualityColorStr(2);
                AttrFrameParam attrFrameParam = new AttrFrameParam();
                attrFrameParam.Title = XStringDefineProxy.GetString("TOOLTIP_ENCHANT_ATTR");
                XEnchantInfo enchantInfo = xequipItem.enchantInfo;
                if (enchantInfo.ChooseAttr > 0U)
                {
                    for (int i = 0; i < xequipItem.enchantInfo.AttrList.Count; i++)
                    {
                        if (enchantInfo.AttrList[i].AttrID == enchantInfo.ChooseAttr)
                        {
                            AttrParam item = default(AttrParam);
                            AttrParam.ResetSb();
                            AttrParam.Append(xequipItem.enchantInfo.AttrList[i], "", "");
                            item.SetTextFromSb();
                            item.SetValueFromSb();
                            attrFrameParam.AttrList.Add(item);
                        }
                    }
                }
                base.AppendFrame(gameObject2, (float)this.SetupAttrFrame(gameObject2, attrFrameParam, bMain), new Vector3?(base.uiBehaviour.m_AttrFramePool.TplPos));
                XSingleton<XGameUI>.singleton.m_uiTool.MarkParentAsChanged(gameObject2);
            }
        }

        // Token: 0x06010B81 RID: 68481 RVA: 0x0042C368 File Offset: 0x0042A568
        private void _SetupSuitFrame(GameObject goToolTip, XItem mainItem, XItem compareItem, bool bMain)
        {
            
            IXUISprite ixuisprite = goToolTip.transform.Find("ScrollPanel/SuitFrame").GetComponent("XUISprite") as IXUISprite;
            //zcg 
            ixuisprite.SetVisible(false);
            return;
            if (mainItem == null)
            {
                ixuisprite.SetVisible(false);
            }
            else
            {
                int itemID = mainItem.itemID;
                EquipSuitTable.RowData suit = XCharacterEquipDocument.SuitManager.GetSuit(itemID, true);
                if (suit == null)
                {
                    ixuisprite.SetVisible(false);
                }
                else
                {
                    ixuisprite.SetVisible(true);
                    if (XSingleton<TooltipParam>.singleton.BodyBag == null)
                    {
                        XSingleton<TooltipParam>.singleton.BodyBag = XSingleton<XGame>.singleton.Doc.XBagDoc.EquipBag;
                    }
                    int num = XEquipSuitManager.GetEquipedSuits(suit, XSingleton<TooltipParam>.singleton.BodyBag, null);
                    if (bMain && XEquipSuitManager.WillChangeEquipedCount(suit, mainItem.itemID, XSingleton<TooltipParam>.singleton.BodyBag))
                    {
                        num++;
                    }
                    int num2 = 0;
                    AttrFrameParam attrFrameParam = new AttrFrameParam();
                    for (int i = 0; i < XEquipSuitManager.GetEffectDataCount(); i++)
                    {
                        int num3 = 0;
                        int effectData = XEquipSuitManager.GetEffectData(suit, i, out num3);
                        if ((float)effectData != 0f)
                        {
                            string text;
                            string color;
                            if (i <= num)
                            {
                                text = "ffffff";
                                color = XSingleton<UiUtility>.singleton.GetColorStr(new Color(0.99607843f, 0.80784315f, 0f));
                            }
                            else
                            {
                                text = XSingleton<UiUtility>.singleton.GetColorStr(new Color(0.5019608f, 0.5019608f, 0.5019608f));
                                color = text;
                            }
                            AttrParam item = default(AttrParam);
                            AttrParam.ResetSb();
                            AttrParam.Append(AttrParam.TextSb, XStringDefineProxy.GetString("EQUIP_SUIT_EFFECT", new object[]
                            {
                                i
                            }), color);
                            string s = string.Format("{0} +{1}", XStringDefineProxy.GetString((XAttributeDefine)effectData), num3);
                            AttrParam.Append(AttrParam.ValueSb, s, text);
                            item.SetTextFromSb();
                            item.SetValueFromSb();
                            attrFrameParam.AttrList.Add(item);
                            num2++;
                        }
                    }
                    if (num2 > 0)
                    {
                        attrFrameParam.Title = string.Format("({0}/{1})", num, suit.SuitNum);
                        base.AppendFrame(ixuisprite.gameObject, (float)this.SetupAttrFrame(ixuisprite.gameObject, attrFrameParam, bMain), null);
                    }
                    else
                    {
                        ixuisprite.SetVisible(false);
                    }
                }
            }
        }

        // Token: 0x06010B82 RID: 68482 RVA: 0x0042C5E8 File Offset: 0x0042A7E8
        protected override void SetupToolTipButtons(GameObject goToolTip, XItem item, bool bMain)
        {
            base.SetupToolTipButtons(goToolTip, item, bMain);
            if (this.bShowButtons)
            {
                if (bMain)
                {
                    XEquipItem xequipItem = item as XEquipItem;
                    if (XSingleton<XGame>.singleton.Doc.XBagDoc.EquipBag.HasItem(item.uid))
                    {
                        base._SetupButtonVisiability(goToolTip, 1, item);
                    }
                    else
                    {
                        base._SetupButtonVisiability(goToolTip, 0, item);
                    }
                }
            }
        }
    }
}
